// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取设备变量列表 GET /api/device/attr */
export async function queryDeviceAttr(
  params: {
    // query
    /** 当前的页码 */
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  },
  options?: { [key: string]: any },
) {
  return request<API.RequestData>('/api/device/attr', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}



/** 获取设备列表 GET /api/device */
export async function querySpecialDeviceAttr(
  params?: any,
  options?: { [key: string]: any },
) {
  return request<API.DeviceItem[]>('/api/device/attr/select', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}


/** 获取设备变量列表 GET /api/device/specific/attr */
export async function querySpecificDeviceAttr(
  params: {
    current?: number;
    /** 页面的容量 */
    pageSize?: number;
  }
 
) {
  return request<API.RequestData>('/api/device/specific/attr', {
    method: 'GET',
    params: {
      ...params,
    },
   
  });
}






/** 添加设备变量 POST /api/device/attr */
export async function addSpecificDeviceAttr(body: API.SysDeviceAttrItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/device/specific/attr', {
    method: 'POST',
    requestType:'form',
    data: body,
    ...(options || {}),
  });
}

/** 更新设备变量 PUT /api/device/attr */
export async function updateDeviceAttr(
  body: API.SysDeviceAttrItem,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/device/attr', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 添加设备变量 POST /api/device/attr */
export async function addDeviceAttr(body: API.SysDeviceAttrItem, options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/device/attr', {
    method: 'POST',
    requestType:'form',
    data: body,
    ...(options || {}),
  });
}

/** 删除设备变量 DELETE /api/device/attr */
export async function removeDeviceAttr(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/device/attr', {
    method: 'DELETE',
    params: {
      ...options,
    },
    ...(options || {}),
  });
}


/** 删除设备变量 DELETE /api/device/attr */
export async function batchRemoveDeviceAttr(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/device/attr/batchdel', {
    method: 'DELETE',
    params: {
      ...options,
    },
    ...(options || {}),
  });
}



/** 更新设备变量 PUT /api/device/specific/attr */
export async function updateDeviceSpecificAttr(
  body: API.SysDeviceAttrItem,
  options?: { [key: string]: any },
) {
  return request<Record<string, any>>('/api/device/specific/attr', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
/** 删除特殊变量 DELETE /api/device/attr */
export async function removeDeviceSpecificAttr(options?: { [key: string]: any }) {
  return request<Record<string, any>>('/api/device/specific/attr', {
    method: 'DELETE',
    params: {
      ...options,
    },
  });
}




/** 获取设备变量列表 GET /api/device/attr/list */
export async function queryDeviceAttrList(  params: {
  deviceId?: number, type?: number}
) {
  return request<API.RequestData>('/api/device/attr/list', {
    method: 'GET',
    params: {
      ...params,
    },
   
  });
}